﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ArithmeticLibrary.Tree
{
    /// <summary>
    /// Trida reprezentujici conisovy uzel stromu.
    /// </summary>
    public class CosineNode : UnaryOperatorNode
    {
        public CosineNode()
        {
            this.Child = null;
        }

        public CosineNode(Node child)
        {
            this.Child = child;
        }

        public override double Evaluate(double x)
        {
            return Math.Cos(Child.Evaluate(x));
        }

        public override R Accept<R, C>(IExpressionVisitor<R, C> visitor, C context)
        {
            return visitor.Visit(this, context);
        }
    }
}
